name | correct guesses | games together | ratio |
---|
name | correct guesses | games together | ratio |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | // example invocation: entry(g,5,5,5,2) void entry(char *grid, size_t width, size_t height, size_t x, size_t y){ size_t abs = (y-1)*width+x-1; size_t tot = width*height; for(int i=abs;!grid[i]&&i>0;i-=width){ for(int j=i;!grid[j]&&j>=i-x+1;j--) grid[j]=1; for(int j=i+1;!grid[j]&&j<=i+width-x;j++) grid[j]=1; } if(!grid[abs]) for(int i=abs+width;i<tot&&!grid[i];i+=width){ for(int j=i;!grid[j]&&j>=i-x;j--) grid[j]=1; for(int j=i+1;!grid[j]&&j<=i+width-x;j++) grid[j]=1; } } |
post a comment